<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>双辉旅程网</title>
    <link rel='stylesheet prefetch' href='https://res.wx.qq.com/open/libs/weui/1.1.0/weui.min.css'>
    <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
    {load href="/api/js/weui.min.js" /}
    <style type="text/css">
        html, body{
            height: 100%;
        }
        body{
            border-color: #efeff4;
        }
    </style>
</head>
<body>
<div class="weui-tab">
    <div class="weui-tab__panel">
        <div class="weui-form-preview">
            <div class="weui-form-preview__hd">
                <label class="weui-form-preview__label">付款金额</label>
                <em class="weui-form-preview__value">¥{$order.total_amount}</em>
            </div>
            <div class="weui-form-preview__bd">
                <p>
                    <label class="weui-form-preview__label">订单号</label>
                    <span class="weui-form-preview__value">{$order.number}</span>
                </p>
                <p>
                    <label class="weui-form-preview__label">积分</label>
                    <span class="weui-form-preview__value">{$order.total_intergral}</span>
                </p>
                <p>
                    <label class="weui-form-preview__label">下单时间</label>
                    <span class="weui-form-preview__value">{$order.created_at}</span>
                </p>
                <p>
                    <label class="weui-form-preview__label">出发时间</label>
                    <span class="weui-form-preview__value">{$order.take_car_date}</span>
                </p>
                <p>
                    <label class="weui-form-preview__label">结束时间</label>
                    <span class="weui-form-preview__value">{$order.leave_car_date}</span>
                </p>
                <p>
                    <label class="weui-form-preview__label">地点</label>
                    <span class="weui-form-preview__value">{$order.take_car_area}</span>
                </p>
            </div>
            <div class="weui-form-preview__ft">
                <a id="s" class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:">支付</a>
            </div>
        </div>

    </div>
    <div class="weui-tabbar">
        <a href="/user/index" class="weui-tabbar__item">
            <img src="http://weui.github.io/weui/images/icon_nav_button.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">我的首页</p>
        </a>
        <a href="/user/car" class="weui-tabbar__item">
            <img src="http://weui.github.io/weui/images/icon_nav_msg.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">我的房车</p>
        </a>
        <a href="/order/index" class="weui-tabbar__item weui-bar__item_on">
            <span style="display: inline-block;position: relative;">
                <img src="http://weui.github.io/weui/images/icon_nav_article.png" alt="" class="weui-tabbar__icon">
                <span class="weui-badge weui-badge_dot" style="position: absolute;top: 0;right: -6px;"></span>
            </span>
            <p class="weui-tabbar__label">我的订单</p>
        </a>
        <a href="/user/index" class="weui-tabbar__item">
            <img src="http://weui.github.io/weui/images/icon_nav_cell.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">我要预约</p>
        </a>
    </div>
</div>


<div id="dialog1" style="display: none;">
    <div class="weui-mask"></div>
    <div class="weui-dialog">
        <div class="weui-dialog__hd"><strong class="weui-dialog__title">订单提示</strong></div>
        <div class="weui-dialog__bd"></div>
        <div class="weui-dialog__ft">
            <a id="cen" href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">取消</a>
            <a id="pay" href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
        </div>
    </div>
</div>
<div id="loadingToast" style="display:none;">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">loading...</p>
    </div>
</div>

<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<input type="hidden" name="order_id" value="{$order.number}">
<script type="text/javascript">
$(document).ready(function(){
    $("#pay").on("click",function(){
        $("#dialog1").hide();
        wx.chooseWXPay({
            timestamp: "{$p['timestamp']}", // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
            nonceStr: "{$p['nonceStr']}", // 支付签名随机串，不长于 32 位
            package: "{$p['package']}", // 统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=***）
            signType: "{$p['signType']}", // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
            paySign: "{$p['paySign']}", // 支付签名
            success: function (res) {
                window.location.href = '/order/index';
            },
            cancel: function (res) {
                alert('确定不支付啦');
            }
        });
    });
    $("#s").on("click",function(){
        $("#dialog1").show();
    });
    $("#cen").on("click",function(){
        $("#dialog1").hide();
    });
});
</script>
<script type="text/javascript">
    wx.config({$config});
</script> 
</body>
</html>